package my.myorm.tool.jdbc;

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 2010-10-22
 * Time: 11:28:03
 * To change this template use File | Settings | File Templates.
 */
public class ResultSetHandlerFactory {
    private static ResultSetHandlerFactory instance=new ResultSetHandlerFactory();
    private ResultSetHandlerFactory(){}

    public static ResultSetHandlerFactory getInstance() {
        return instance;
    }

    public ResultSetHandler getResultSetHandler(String sqlProduct) throws Exception {
        if(sqlProduct.equalsIgnoreCase("mysql")){
            return new MySqlResultSetHandler();
        }else{
            throw new Exception("unknown sql product:"+sqlProduct);
        }
    }
}
